/**
 * @file ptrSwap.c
 * @author your name (you@domain.com)
 * @brief 利用指针重写交换值的函数
 * @version 0.1
 * @date 2022-11-15
 * 
 * @copyright Copyright (c) 2022
 * 
 */
#include <stdio.h>
int *swap(int *,int *);
int main()
{
    int num1,num2;
    scanf("%d%d",&num1,&num2);
    printf("Before:num1=%d,num2=%d\n",num1,num2);
    int *res = swap(&num1,&num2);
    printf("After:num1=%d,num2=%d,the first num=%d",num1,num2,*res);
    return 0;
}
int *swap(int *n1,int *n2)
{
    int tmp;
    tmp=*n1;
    *n1 = *n2;
    *n2=tmp;
    return n1;
}